package summer_vacation.xuejiahua;

import java.util.Scanner;

/**输入某正整形数,判断它是否是素数
 * Created by Administrator on 2015/8/28.
 */
public class java_12 { public static void main(String[] args){
    Scanner input = new Scanner(System.in);
    System.out.println("请输入一个数：");
    int a = input.nextInt();
    boolean isF = true;

    for(int i=2;i<a;i++)
    {
        if(a%i==0){
            isF = false;
            break;
        }else{
            continue;
        }
    }
    if(isF){
        System.out.print(a+"是素数");
    }else{
        System.out.print(a+"不是素数");
    }

}
}
